package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bean.CarBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ICarMapper extends BaseMapper<CarBean> {
    @Select("select c.*,p.p_name,p.p_price,p.p_address " +
            "from t_car c,t_product p " +
            "where c.fk_productId = p.pk_productId and c.fk_userId =#{id}")
    @ResultMap("carMap")
    public List<CarBean> findByUser(int userId);
}
